package com.dog.basics.bean.model.sys;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 系统用户
 */
@Data
@TableName("dog_sys_user")
public class SysUser implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 用户ID
	 *
	 */
	@TableId(value = "user_id", type = IdType.ID_WORKER)
	private Long userId;

	/**
	 * 真实姓名
	 */
	@NotBlank(message="真实姓名不能为空")
	@Size(min = 2,max = 20,message = "真实姓名长度要在2-5之间")
	@ApiModelProperty(value = "真实姓名", dataType = "String",required = false, example = "")
	private String name;

	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空")
	@Size(min = 2,max = 20,message = "用户名长度要在2-20之间")
	@ApiModelProperty(value = "用户名", dataType = "String",required = false, example = "")
	private String username;

	/**
	 * 密码
	 */
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String password;

	/**
	 * 邮箱
	 */
	@NotBlank(message="邮箱不能为空")
	@Email(message="邮箱格式不正确")
	@ApiModelProperty(value = "邮箱", dataType = "String",required = false, example = "")
	private String email;

	/**
	 * 手机号
	 */
	@ApiModelProperty(value = "手机号", dataType = "String",required = false, example = "")
	@Pattern(regexp="0?1[0-9]{10}",message = "请输入正确的手机号")
	private String mobile;

	/**
	 * 父类标识
	 */
	@TableField("parent_id")
	private Long parentId;

	/**
	 * 账号类型 0 - 主  1-子账号
	 */
	@TableField("account_level")
	private Integer accountLevel;


	/**
	 * 状态  0：禁用   1：正常
	 */
	@ApiModelProperty(value = "状态  0：禁用   1：正常", dataType = "Integer",required = false, example = "")
	private Integer status;
	
	/**
	 * 创建者
	 */
	private Long createUserId;

	/**
	 * 创建时间
	 */
	private Long createTime;

	/**
	 * 账户类型   1-管理员 2-校长 3-老师
	 */
	@ApiModelProperty(value = "账户类型  1-管理员 2-代理商", dataType = "Integer",required = false, example = "")
	@TableField("account_type")
	private Integer accountType;

	/**
	 * 幼儿园ID
	 */
	@ApiModelProperty(value = "幼儿园ID", dataType = "Long",required = false, example = "")
	@TableField("kindergarten_id")
	private Long kindergartenId;

	/**
	 * 角色ID列表
	 */
	@TableField(exist=false)
	private List<Long> roleIdList;


}
